<?php

declare(strict_types=1);

namespace App\Model;



/**
 * @property int $id ID
 * @property int $room_id 房间ID
 * @property int $userid 用户ID
 * @property int $add_time 加入时间
 * @property-read null|User $user 
 */
class LiveManager extends Model
{
    /**
     * The table associated with the model.
     */
    protected ?string $table = 'live_manager';

    /**
     * The attributes that are mass assignable.
     */
    protected array $fillable = ['id', 'room_id', 'userid', 'add_time'];

    /**
     * The attributes that should be cast to native types.
     */
    protected array $casts = ['id' => 'integer', 'room_id' => 'integer', 'userid' => 'integer', 'add_time' => 'integer'];

    public function user(){
        return $this->belongsTo(User::class, 'userid', 'id');
    }
}
